home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4869 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help: need to read a file name from a file and pass to func. to open another file
  5. Date: 7 Feb 1996 07:56 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <7FEB199607563377@erich.triumf.ca>
  9. References: <4f9o94$s5v@news.microsoft.com>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4f9o94$s5v@news.microsoft.com>, jparker@wolfenet.com (J Parker) writes...
  14. >Need help:
  15. >I know what your thinking but I'm really an operator not a developer, and 
  16. >I work grave so no around here at the time programs anything but maybe 
  17. >VB (uhgg..  ;-) ).
  18. >I'm trying to read a file full of file names, extract each name, pass one 
  19. >name at a time to a function which opens the file and extracts info.  
  20. >Both files are ascii.  In the first part, I read the file and put the 
  21. >file names into a 2 dimension character array.  I then call the function, 
  22. >passing one row at a time in a loop till all the files have been read.  
  23. >The problem is that when I pass what has now effectively become a char 
  24. >string to the function, fopen() blows chunks on the "\0" character that C 
  25. >places at the endof all char strings.  (I've deduced this from debugging 
  26. >code placed in the source, I may be way off here, comments ...)
  27.  
  28. fopen() _requires_ the '\0' character at the end of the string - that is how C
  29. functions know where the end of the string is!  Perhaps some real code, and an
  30. indication of the actual error, would help us provide a useful remedy to your
  31. problem.
  32.  
  33. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  34. Internet: bennett@triumf.ca         | of one another only when one can be
  35. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  36. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  37. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.